<?php 
$mail = $mvc->getObject(ContentController::RESULT);
$errors = $mvc->getObject(ContentController::ERROR);
?>
<h2>_i18n{New Mail}</h2>
<div class="unitABlock unitABlockLast">
<?php if (isset($errors )){?>
	<div class="itemWarning">
		<ul>
			<?php foreach ($errors as $key => $value){?>
				<li><?php echo $value ?></li>
			<?php } ?>					
		</ul>
	</div>
<?php } ?>
	<form action="/new-mail.html" method="POST">
		<div class="unitSnColumn">
			<div class="itemForm">
				<label>_i18n{To}:</label>
				<div class="itemData"><input class="inpTxt" type="text" name="<?php echo MailService::GETTER ?>" value="<?php echo isset($mail[MailService::GETTER]) ? $mail[MailService::GETTER] : NULL; ?>"/></div>
			</div>
			<div class="itemForm">
				<label>_i18n{Subject}:</label>
				<div class="itemData">
					<input class="inpTxt" type="text" name="<?php echo MailService::SUBJECT ?>" value="<?php echo isset($mail[MailService::SUBJECT]) ? $mail[MailService::SUBJECT] : NULL; ?>"/>
				</div>
			</div>
			<div class="itemForm">
				<label>_i18n{Body}:</label>
				<div class="itemData"><textarea class="areaTxt" rows="10" cols="82" name="<?php echo MailService::TEXT ?>"><?php echo isset($mail[MailService::SUBJECT]) ? $mail[MailService::TEXT] : NULL; ?></textarea></div>
			</div>
		</div>
		<div class="unitBtn">
			<button name="send"><span><strong>_i18n{Send}</strong></span></button>
			<button name="back"><span><strong>_i18n{Discard}</strong></span></button>
		</div>
	</form>
</div>